<style>
    body{
        background-color: #f9f9f9;
        overflow-y: auto;
    }
</style>
<table class="table table-hover">
    <tr class="info">
        {% if lastVersion is defined %}
            <th>应用最新版本</th>
        {% endif %}
        <th>学校使用版本</th>
        <th>学校</th>
    </tr>
    {% for version,school in appInfo %}
        {% for name in school %}
            <tr>
                {% if loop.first %}
                    {% if lastVersion is defined %}
                        <td rowspan="{{ school|length }}">{{ lastVersion['versionName'] }}</td>
                    {% endif %}
                    <td rowspan="{{ school|length }}">{{ version }}</td>
                {% endif %}
                <td>{{ name }}</td>
            </tr>
            {% if loop.last %}
            <tr class="success">
                <td>小计</td>
                {% if lastVersion is defined %}
                    <td></td>
                {% endif %}
                <td>{{ school|length }}</td>
            </tr>
            <tr><td></td><td></td>{% if lastVersion is defined %}<td></td>{% endif %}</tr>
            {% endif %}
        {% endfor %}
    {% endfor %}
</table>